 
from sklearn import datasets
 
iris_data = datasets.load_iris()
print(iris_data.DESCR)
X_arr = iris_data.data
y_arr = iris_data.target
 
def iris_data_plot(X_arr, y_arr):
    import matplotlib.pyplot as plt
    plt.figure()
    setosa_data = X_arr[y_arr == 0]
    plt.scatter(setosa_data[:, 0], setosa_data[:, 1], color="r", label="Iris_setosa")
 
    versicolor_data = X_arr[y_arr == 1]
    plt.scatter(versicolor_data[:, 0], versicolor_data[:, 1], color="g", label="Iris_versicolor")
 
    virginica_data = X_arr[y_arr == 2]
    plt.scatter(virginica_data[:, 0], virginica_data[:, 1], color="b", label="Iris_virginica")
    plt.legend()
    plt.title('Iris plants dataset,Instances=150, Attributes=4')
    plt.show()
iris_data_plot(X_arr, y_arr)